/*
 * DataInputStreamX.java
 *
 * Created on 16 de enero de 2008, 02:32 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package pe.com.nextel.rms;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 *
 * @author ibonilla
 */
public class DataInputStreamX extends DataInputStream{
    
      /** Creates a new instance of DataInputStreamX */
    public DataInputStreamX(InputStream is) {
        super(is);
    }
    
    public String readString() throws IOException {
       
        int strLen = readInt();
        
        char[] str = new char[strLen];
        for (int it=0; it<strLen;it++){
            str[it]=readChar();
        }
        
        return new String(str);              
    }
    
    //aMendiola 21/10/2010
    public String readStringShort() throws IOException {
        int strLen = readShort();
        
        //System.out.println("strLen short: " + strLen);
        
        char[] str = new char[strLen];
        for (int it=0; it<strLen;it++){
            str[it]=readChar();
        }       
        
        return new String(str);              
    }
    
    //aMendiola 21/10/2010
    public String readStringByte() throws IOException {
        int strLen = readByte();
        
        //System.out.println("strLen byte: " + strLen);
        
        char[] str = new char[strLen];
        for (int it=0; it<strLen;it++){
            str[it]=readChar();
        }       
        
        return new String(str);              
    }     
     
    
    
}
